GDK W32: Ensure correct stacking of popup windows
authorРуслан Ижбулатов <lrn1986@gmail.com>
Sat, 1 Jun 2019 19:11:13 +0000 (19:11 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Sat, 1 Jun 2019 19:23:30 +0000 (19:23 +0000)
commit2ace3113d69db8bacb915161559ec91a4477f148
tree3cd598ee8b15b01df53ea61e26fac589f8f96438
parent0ee9a4ff9080ed15d4b33a40ab910534fb70c634
GDK W32: Ensure correct stacking of popup windows

1) In the SetWindowPos() function (and the WINDOWPOS struct) the
   "hWndInsertAfter" argument/field means the window that will be
   directly above after the change, not the window that will be
   directly below. MSDN says "precedes" for SetWindowPos(), but
   WINDOWPOS documentation is more precise: this is the window
   behind which the affected window will be placed. Apparently,
   Z-axis goes back-to-front.
   Therefore, logging should be reworded correctly.

2) When we switch away from the application and then switch back
   to a transient window, we need to bring up its transient-owner
   (and its transient-owner's owner and so forth) as well,
   otherwise our transient (modal) window might be transient for
   something that might not be visible.

3) When we bring up a window, we should bring all of its children
   (popup windows) on top of it.
   Because Windows doesn't provide a function to bring one window
   on top of the other, we have to work around this by calling
   SetWindowPos() twice, swapping the windows between the calls.
gdk/win32/gdkevents-win32.c